import requests
from lxml import etree
import time
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
}

page = ''
for i in range(10):
    if i > 0:
        page = '_'+str(i)
    url = f'http://www.cs.ecitic.com/newsite/cpzx/jrcpxxgs/zgcp/index{page}.html'
    print(url)
    res = requests.get(url, headers=headers)
    html = res.content.decode()
    # 进行xpath处理
    tree = etree.HTML(html)
    li_list = tree.xpath('//ul[@class="list-con"]/li')
    for li in li_list:
        print(li.xpath('./span/text()'))
    print(url, '抓取完成')
    time.sleep(1)
"""
http://www.cs.ecitic.com/newsite/cpzx/jrcpxxgs/zgcp/index.html
http://www.cs.ecitic.com/newsite/cpzx/jrcpxxgs/zgcp/index_1.html
http://www.cs.ecitic.com/newsite/cpzx/jrcpxxgs/zgcp/index_2.html
"""